package com.scau.XFourPOS.dao;
import java.io.Serializable;
import java.util.List;
import java.util.Map;

import org.hibernate.Query;
import org.hibernate.Session;

import com.scau.XFourPOS.utils.PageUtils;
/**     
 * 类名称：BaseDao<T>
 * 类描述：dao接口，泛型类
 * 创建人：庄祥鹏
 * */
public interface BaseDao<T> {
	public Session getSession();
	public void saveOrUpdateEntity(T entity);

	public void deleteEntity(T entity);
	public void deleteEntityById(Serializable id);
	
	public T loadEntity(final Class<T> entityClass, final Serializable id);
	public T loadEntityById(Serializable id);
	
	public <X> List<X> find(final String hql, final Object... values);
	public <X> List<X> find(final String hql, final Map<String, ?> values);
	public <X> X findUnique(final String hql, final Object... values);
	public <X> X findUnique(final String hql, final Map<String, ?> values);
	
	public int batchExecute(final String hql, final Object... values);
	public int batchExecute(final String hql, final Map<String, ?> values);
	
	public void initProxyObject(Object proxy);
	public void flush();
	public Query distinct(Query query);
	public String getIdName();
	public PageUtils<T> getAll(final PageUtils<T> page);
	public PageUtils<T> findPage(final PageUtils<T> page, final String hql, final Object... values);
	public PageUtils<T> findPage(final PageUtils<T> page, final String hql, final Map<String, ?> values);
	
	
	
}